from google.appengine.api import users
from google.appengine.ext import db

class Board(db.Model):
    bid = db.IntegerProperty()
    name = db.StringProperty()

class Post(db.Model):
    board = db.ReferenceProperty(Board, collection_name='posts' )
    parent_post = db.SelfReferenceProperty(collection_name='children')
    pid = db.IntegerProperty()
    title = db.StringProperty()
    content = db.TextProperty()
    author = db.StringProperty()
    posted = db.DateTimeProperty()

    # TODO:
    #  * How to retrieve an article ( need to combine serveral posts )
    #  * How to retrieve articles in specified page.
